<?php echo $this->Html->css(array("nivo-default","nivo-slider"));?>
<div id="content-index">
<div class="slider-wrapper theme-default">
        <div id="slider" class="nivoSlider">
            <?php 
			$img2 = search($imgs,'status',1);
			//debug($img2);
			if(!empty($img2)){
			foreach($img2 as $img){?>            
				<?php if(is_file('files/uploads/images/'.$img['url'])){?>
                <img src="<?php echo $this->webroot;?>files/uploads/images/<?php echo $img['url'];?>" width="615" height="245" title="#disp<?php echo $img['Plan']['id'];?>">
            <?php }else{?>
                    <img width="615" height="250" src="<?php echo $this->webroot;?>img/no-image.jpg" class="alignleft featured_image" title="#disp<?php echo $img['Plan']['id'];?>">
                    <?php }?>
            <?php }?>
            <?php }else{ ?>
					<img width="615" height="250" src="<?php echo $this->webroot;?>img/no-image.jpg" class="alignleft featured_image" title="#disp<?php echo "Không có dự án nào";?>">
			<?php }?>
        </div>
        <?php foreach($imgs as $imgs){?>
            <div id="disp<?php echo $imgs['Plan']['id'];?>" class="nivo-html-caption">
                 <?php echo $this->Html->link($imgs['Plan']['name'],array('controller'=>'plans','action'=>'view',$this->Link->seo($imgs['Plan']['id'],$imgs['Plan']['name'])));?>
            </div>
        <?php }?>
    </div>
    <?php echo $this->Html->script(array("jquery.nivo.slider"));?>
    <script type="text/javascript">
        jQuery(window).load(function(){
            jQuery("#slider").nivoSlider({
                effect:"random",
                slices:15,
                boxCols:8,
                boxRows:4,
                animSpeed:500,
                pauseTime:3000,
                startSlide:0,
                directionNav:true,
                controlNav:true,
                controlNavThumbs:false,
                pauseOnHover:true,
                manualAdvance:false
            });
        });
    </script>

    <?php  foreach ($menu as $k=>$v):?>
    <div class="social-profiles-widget">
      <h3 class="widgettitle clear"><span><?php echo $this->Html->link($v,array('controller'=>'news','action'=>'pages',$this->Link->seo($k,$v)));?></span></h3>
    <?php $news = $this->requestAction('/news/listnews/'.$k);?>
	<?php //debug($news);?>
    <?php foreach ($news as $a=>$b):?>
    <div class="clearfix post baiviet-<?php echo $a;?>" style="margin-left:5px; margin-right:5px;">
         <div class="entry clearfix">
            	<a href="<?php echo $this->webroot;?>news/chitiet/<?php echo $this->Link->seo($b['News']['id'],$b['News']['title']);?>" title="<?php echo $b['News']['title'];?>" rel="bookmark">
				<?php if(is_file('files/uploads/news/'.$b['News']['image'])){?>
                <img width="120" height="90" src="<?php echo $this->webroot;?>files/uploads/news/<?php echo $b['News']['image'];?>" class="alignleft featured_image" alt="<?php echo $b['News']['image'];?>" title="<?php echo $b['News']['title'];?>">
                <?php }else{?>
                    <img width="120" height="90" src="<?php echo $this->webroot;?>img/no-image.jpg" class="alignleft featured_image" alt="<?php echo $b['News']['image'];?>" title="<?php echo $b['News']['title'];?>">
                <?php }?>
            </a>
        </div>
		<div class="title">
           <?php echo $this->Html->link($this->Text->truncate($b['News']['title'],70, array('ending' => '...','exact' => true,'html' => false)),array('controller'=>'news','action'=>'chitiet',$this->Link->seo($b['News']['id'],$b['News']['title'])),array('title'=> $b['News']['title'],'rel'=>"bookmark"));?>
       </div>
       <p><?php echo $b['News']['shortcontent'];?></p>
    </div>
     <?php endforeach;?>
    <!-- End Post -->
    <div class="clear"></div>
    </div>
     <div style="height:8px;"></div>
     <?php endforeach;?>
   
    <?php //debug($news);?>
</div>
<!-- #content -->

<?php echo $this->element('news-right');?>